home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Dylan Related / Mindy / Mindy 1.2 - portable sources / comp / lexenv.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-15  |  2.1 KB  |  70 lines  |  [TEXT/ttxt]

  1. /**********************************************************************\
  2. *
  3. *  Copyright (c) 1994  Carnegie Mellon University
  4. *  All rights reserved.
  5. *  
  6. *  Use and copying of this software and preparation of derivative
  7. *  works based on this software are permitted, including commercial
  8. *  use, provided that the following conditions are observed:
  9. *  
  10. *  1. This copyright notice must be retained in full on any copies
  11. *     and on appropriate parts of any derivative works.
  12. *  2. Documentation (paper or online) accompanying any system that
  13. *     incorporates this software, or any part of it, must acknowledge
  14. *     the contribution of the Gwydion Project at Carnegie Mellon
  15. *     University.
  16. *  
  17. *  This software is made available "as is".  Neither the authors nor
  18. *  Carnegie Mellon University make any warranty about the software,
  19. *  its performance, or its conformity to any specification.
  20. *  
  21. *  Bug reports, questions, comments, and suggestions should be sent by
  22. *  E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  23. *
  24. ***********************************************************************
  25. *
  26. * $Header: lexenv.c,v 1.3 94/10/05 20:55:13 nkramer Exp $
  27. *
  28. * This file implements the stuff to keep track of what is in the lexical
  29. * environment.
  30. *
  31. \**********************************************************************/
  32.  
  33. #include "../compat/std-c.h"
  34.  
  35. #include "mindycomp.h"
  36. #include "src.h"
  37. #include "lexenv.h"
  38.  
  39. struct binding *make_binding(struct id *id, struct symbol *type,
  40.                  boolean argument, int offset,
  41.                  struct method *home, struct binding *next)
  42. {
  43.     struct binding *res = malloc(sizeof(struct binding));
  44.  
  45.     res->id = id;
  46.     res->type = type;
  47.     res->home = home;
  48.     res->function = FALSE;
  49.     res->closed_over = FALSE;
  50.     res->set = FALSE;
  51.     res->argument = argument;
  52.     res->offset = offset;
  53.     res->next = next;
  54.  
  55.     return res;
  56. }
  57.  
  58. struct lexenv *make_lexenv(struct method *method, struct binding *bindings,
  59.                int depth)
  60. {
  61.     struct lexenv *res = malloc(sizeof(struct lexenv));
  62.  
  63.     res->method = method;
  64.     res->bindings = bindings;
  65.     res->depth = depth;
  66.  
  67.     return res;
  68. }
  69.  
  70.